﻿#include "CashReturn.h"

CashReturn::CashReturn(QString moneyCondition, QString moneyReturn)
{
    m_moneyCondition = moneyCondition.toDouble();
    m_moneyReturn = moneyReturn.toDouble();
}

double CashReturn::acceptCash(double money)
{
    double result = money;
    if (money >= m_moneyCondition) {
        result = money - int(money/m_moneyCondition) * m_moneyReturn;
    }
    return result;
}
